﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>后台管理系统</title>
    <meta name="sourcefiles" content="leftmenu.aspx" />
</head>
<body>
    <form id="form1" runat="server">
    <f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server"></f:PageManager>
    <f:Panel ID="Panel1" Layout="Region" ShowBorder="false" ShowHeader="false" runat="server">
        <Items>
            <f:Panel ID="Region2" RegionPosition="Left" RegionSplit="true" Width="180px" ShowHeader="true"
                Title="导航菜单" Icon="Outline" EnableCollapse="false" EnableIFrame="true" IFrameName="leftframe"
                IFrameUrl="about:blank" runat="server">
            </f:Panel>
            <f:TabStrip ID="mainTabStrip" RegionPosition="Center" EnableTabCloseMenu="true" EnableFrame="false"
                AutoScroll="false" ShowBorder="false" runat="server">
                <Tabs>
                    <f:Tab ID="Tab1" Title="首页" Layout="Fit" Icon="House" CssClass="maincontent" runat="server">
                        <Items>
                            <f:ContentPanel ID="ContentPanel1" ShowBorder="false" BodyPadding="10px" ShowHeader="false"
                                AutoScroll="true" runat="server">
                            </f:ContentPanel>
                        </Items>
                    </f:Tab>
                </Tabs>
            </f:TabStrip>
        </Items>
    </f:Panel>
    </form>
    <script src="../js/jquery-1.10.2.min.js" type="text/javascript"></script>
    <%--<script src="extjs/ext-part1.js" type="text/javascript"></script>
    <script src="extjs/ext-part2.js" type="text/javascript"></script>
    <script src="extjs/ext-theme-neptune.js" type="text/javascript"></script>
    <script src="extjs/lang/zh_CN.js" type="text/javascript"></script>--%>
    <script type="text/javascript">
        var mainTabStripClientID = '<%= mainTabStrip.ClientID %>';

        function addTab(id, url, title, closable) {
            F('<%= mainTabStrip.ClientID %>').addTab(id, url, title, closable);
        }

        //操作成功，关闭当前标签页，刷新指定标签页
        //        function Success() {
        //            try {
        //                F('<%= mainTabStrip.ClientID %>').removeTab(F('<%= mainTabStrip.ClientID %>').getActiveTab().id); //关闭当前页面
        //                $(window.frames["fnode4"].document).find("#Panel7_ctl00_btnRefresh-btnInnerEl").click(); //fnode4指定标签页ID 。按左侧菜单顺序排列 
        //                F('<%= mainTabStrip.ClientID %>').f_setActiveTab('fnode4'); //fnode1
        //            } catch (e) {

        //            }
        //        }

        F.ready(function () {

            window.mainTabStrip = F(mainTabStripClientID);

            var menuLis = $('.menu ul li');

            function updateLeftMenu(menuType) {

                menuLis.removeClass('selected');
                menuLis.filter('.menu-' + menuType).addClass('selected');

                window.frames['leftframe'].location.href = 'leftmenu.aspx?menu=' + encodeURIComponent(menuType);
            }

            // 点击顶部菜单，加载左侧IFrame菜单
            menuLis.click(function (e) {
                var $this = $(this);
                var classNames = /menu\-(\w+)/.exec($this.attr('class'));
                if (classNames.length == 2) {
                    var menuType = classNames[1];

                    updateLeftMenu(menuType);
                }
            });

            // 根据页面的Hash值，来初始化左侧IFrame菜单
            var hash = window.location.hash;
            var hashArray = /.+\/html\/(.+)\-\d+\.html/.exec(hash);
            if (hashArray && hashArray.length === 2) {
                updateLeftMenu(hashArray[1]);
            } else {
                updateLeftMenu('mail');
            }


            window.initTreeTabStrip = function (tree) {
                // 初始化主框架中的树(或者Accordion+Tree)和选项卡互动，以及地址栏的更新
                // treeMenu： 主框架中的树控件实例，或者内嵌树控件的手风琴控件实例
                // mainTabStrip： 选项卡实例
                // addTabCallback： 创建选项卡前的回调函数（接受tabConfig参数）
                // updateLocationHash: 切换Tab时，是否更新地址栏Hash值
                // refreshWhenExist： 添加选项卡时，如果选项卡已经存在，是否刷新内部IFrame
                // refreshWhenTabChange: 切换选项卡时，是否刷新内部IFrame
                // hashWindow：需要更新Hash值的窗口对象，默认为当前window
                F.util.initTreeTabStrip(tree, mainTabStrip, null, true, false, false);
            };



        });
 
 
    </script>
</body>
</html>
